package com.bbdjt.weixin.web.action.userHeartbeat;

import java.util.Date;
import java.util.concurrent.TimeoutException;

import net.rubyeye.xmemcached.MemcachedClient;
import net.rubyeye.xmemcached.exception.MemcachedException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.bbdjt.weixin.base.action.BaseAction;
import com.bbdjt.weixin.model.UserHeartbeat;
import com.bbdjt.weixin.service.UserHeartbeatService;

@Controller
public class UserHeartbeatAction extends BaseAction{
	
	@Autowired
	private UserHeartbeatService userHeartbeatService;
	
	@Autowired
	private MemcachedClient memcachedClient;
	
	/**
	 * 记录患者听课时长
	 * @param userHeartbeat
	 * @return
	 * @throws MemcachedException 
	 * @throws InterruptedException 
	 * @throws TimeoutException 
	 */
	@RequestMapping(value="addUserHeartbea", produces="application/json;charset=UTF-8")
	public void addUserHeartbea (UserHeartbeat userHeartbeat){
		userHeartbeat.setCreateDate(new Date());
		userHeartbeatService.insertSelective(userHeartbeat);
	}
}
